package first.niuke.simple;

/**
 * @ClassName NC72
 * @description:
 * @author: 荣燊
 * @create: 2021-06-15 16:02
 **/
public class NC72 {
    // 二叉树的镜像
    public TreeNode Mirror (TreeNode pRoot) {
        // write code here
        if (pRoot == null) {
            return null;
        }

        TreeNode lnode = Mirror(pRoot.left);
        TreeNode rnode = Mirror(pRoot.right);
        pRoot.left = rnode;
        pRoot.right = lnode;

        return pRoot;

    }




    public class TreeNode {
        int val = 0;
        TreeNode left = null;
        TreeNode right = null;
        public TreeNode(int val) {
            this.val = val;
        }
    }
}
